<template>
	<view class="template-home tn-safe-area-inset-bottom">






		<tn-nav-bar fixed customBack :bottomShadow="false" backgroundColor="#FFFFFF00">
			<view slot="back" class='tn-custom-nav-bar__back' @click="goBack">
				<text class='icon tn-icon-left-arrow tn-color-black'></text>
			</view>
			<view class="tn-flex tn-flex-col-center tn-flex-row-center ">
				<text class="tn-text-xl tn-color-black">到期租客</text>
			</view>
		</tn-nav-bar>




		<view class="tn-margin-top-xl">

			<!-- 图文信息 -->
			<block v-for="(item,index) in content">
				<view class="carpool__item home-shadow tn-margin-left tn-margin-right tn-margin-bottom" :key="index">
					<view class="carpool__author tn-flex tn-flex-row-between tn-flex-col-center">
						<view class="justify__author__info" @click="tn('')">
							<view class="tn-flex tn-flex-row-center">
								<view class="tn-flex tn-flex-row-center tn-flex-col-center">
									<view class="user-pic">
										<view class="user-image"
											:style="'background-image:url(' + (item.userAvatar ? item.userAvatar : otherAvatar) + ')'">
											
										</view>
									</view>

									<view class="tn-padding-right tn-text-ellipsis">
										<view class="tn-padding-right tn-padding-left-sm tn-text-lg">{{ item.tenantName }}
										</view>
										<view class="tn-padding-right tn-padding-left-sm tn-color-gray tn-text-sm"
											style="padding-top: 7rpx;">{{ item.date }}</view>
									</view>
								</view>
							</view>
						</view>
						<!-- <view class="justify-content-item tn-flex-col-center tn-flex-row-center">
							<text class="tn-text-df" style="color: #46C265;">{{ item.time }}</text>
							<text class="tn-text-df tn-color-gray tn-padding-left-xs">小时后出发</text>
						</view> -->
					</view>

					<view class="king-list tn-padding-top">
						<view class='king-item tn-icon-circle-fill' style="color: #46C265;">
							<view class="resume">
								<view class="tn-text-left">{{ item.tenantPhone }}</view>
							</view>
						</view>

						<view class='king-item tn-color-orange tn-icon-circle-fill'>
							<view class="resume">
								<view class="tn-text-left">{{ item.tenantIdNumber }}</view>
							</view>
						</view>

						<view class='king-item tn-color-gray--disabled tn-icon-circle-fill'>
							<view class="resume">
								<view class="tn-text-left">开始时间：{{ item.startDate }} ~ 到期时间：{{ item.endDate }}</view>
							</view>
						</view>
					



					</view>

				</view>
			</block>
		</view>

		<view class="tn-tabbar-height"></view>

	</view>
</template>

<script>
	import {
		getExpiredTenantin
	} from '@/api/house/room/index'

	export default {
		name: 'Home',
		data() {
			return {
				content: [],
				otherAvatar:'/static/images/room/x32.jpg'

			}
		},
		created() {
			this.expiredTenantin();
		},
		methods: {

			expiredTenantin() {
				getExpiredTenantin().then(response => {
					this.content = response.data;
					console.log("content", response)
				})
			},

			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			},

			// 返回首页
			tnindex(e) {
				uni.reLaunch({
					url: e,
				});
			},

		}
	}
</script>

<style lang="scss" scoped>
	.template-home {
		max-height: 94vh;
		max-height: calc(94vh + env(safe-area-inset-bottom) / 2);
		max-height: calc(94vh + constant(safe-area-inset-bottom));
	}

	/* 阴影*/
	.home-shadow {
		background-color: #FFFFFF;
		border-radius: 24rpx;
	}

	/* 自定义导航栏内容 start */
	.custom-nav {
		height: 100%;

		&__back {
			margin: auto 5rpx;
			font-size: 40rpx;
			margin-right: 10rpx;
			margin-left: 30rpx;
			flex-basis: 5%;
		}

		&__search {
			flex-basis: 50%;
			width: 100%;
			height: 100%;

			&__box {
				width: 100%;
				height: 74%;
				padding: 10rpx 0;
				margin: 0 30rpx;
				background-color: rgba(255, 255, 255, 0.5);
				border-radius: 1000rpx;
				border: 1rpx solid #46C265;
				color: #FFFFFF;
				font-size: 24rpx;
			}

			&__icon {
				padding-right: 10rpx;
				margin-left: 20rpx;
				font-size: 30rpx;
			}

			&__text {
				// color: #AAAAAA;
			}
		}
	}

	.logo-image {
		width: 65rpx;
		height: 65rpx;
		position: relative;
	}

	.logo-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border-radius: 50%;
		border: 1rpx solid #FFFFFF;
	}

	/* 自定义导航栏内容 end */


	/* 轮播视觉差 start */
	.card-swiper {
		height: 220rpx !important;
	}

	.card-swiper swiper-item {
		width: 750rpx !important;
		left: 0rpx;
		box-sizing: border-box;
		padding: 0rpx 30rpx 0rpx 30rpx;
		overflow: initial;
	}

	.card-swiper swiper-item .swiper-item {
		width: 100%;
		display: block;
		height: 100%;
		border-radius: 24rpx;
		transform: scale(1);
		transition: all 0.2s ease-in 0s;
		will-change: transform;
		overflow: hidden;
	}

	.card-swiper swiper-item.cur .swiper-item {
		transform: none;
		transition: all 0.2s ease-in 0s;
		will-change: transform;
	}

	.card-swiper swiper-item .swiper-item-text {
		margin-top: -220rpx;
		text-align: center;
		width: 100%;
		display: block;
		height: 100%;
		border-radius: 10rpx;
		transform: translate(100rpx, 0rpx) scale(0.9, 0.9);
		transition: all 0.6s ease 0s;
		will-change: transform;
		overflow: hidden;
	}

	.card-swiper swiper-item.cur .swiper-item-text {
		margin-top: -220rpx;
		width: 100%;
		transform: translate(0rpx, 0rpx) scale(0.9, 0.9);
		transition: all 0.6s ease 0s;
		will-change: transform;
	}

	.image-banner {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.image-banner image {
		width: 100%;
		height: 100%;
	}

	/* 轮播指示点 start*/
	.indication {
		z-index: 9999;
		width: 100%;
		height: 36rpx;
		position: absolute;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.spot {
		background-color: #FFFFFF;
		opacity: 0.6;
		width: 10rpx;
		height: 10rpx;
		border-radius: 20rpx;
		top: -50rpx;
		margin: 0 8rpx !important;
		position: relative;
	}

	.spot.active {
		opacity: 0.8;
		width: 30rpx;
		background-color: #FFFFFF;
	}

	/* 图标容器5 start */
	.icon6 {
		&__item {
			// width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 0rpx;
			margin: 0rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 160rpx;
				height: 160rpx;
				// border-radius: 100rpx;
				position: relative;
				z-index: 1;
			}
		}
	}

	.clamp-text-1 {
		-webkit-line-clamp: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.clamp-text-2 {
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.icon12 {
		&__item {
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 100rpx;
				height: 100rpx;
				font-size: 60rpx;
				border-radius: 50%;
				margin-bottom: 18rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
					background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg2.png);


				}
			}
		}
	}


	/* 胶囊banner*/
	.image-capsule {
		padding: 100rpx 0rpx;
		font-size: 40rpx;
		font-weight: 300;
		position: relative;
	}

	.image-piccapsule {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border-radius: 20rpx 20rpx 0 0;
	}

	/* 分类展示 start */
	.carpool-type {

		&__container {
			margin-top: 10rpx;
			margin-bottom: 50rpx;
		}

		&__item {
			width: 47.7%;
			margin: 15rpx 0rpx 30rpx 0rpx;
			padding: 40rpx 30rpx;
			border-radius: 10rpx;


			position: relative;
			z-index: 1;

			&::after {
				content: " ";
				position: absolute;
				z-index: -1;
				width: 100%;
				height: 100%;
				left: 0;
				bottom: 0;
				border-radius: inherit;
				opacity: 1;
				transform: scale(1, 1);
				background-size: 100% 100%;
				background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/2.png);
			}

			&__bottom {
				box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.12);
				border-radius: 0 0 10rpx 10rpx;
				position: absolute;
				width: 85%;
				line-height: 15rpx;
				left: 50%;
				bottom: -15rpx;
				transform: translateX(-50%);
				z-index: -1;
				text-align: center;
			}
		}
	}

	/* 分类展示 end */

	/* 间隔线 start*/
	.tn-strip-bottom {
		width: 100%;
		border-bottom: 20rpx solid rgba(241, 241, 241, 0.8);
	}

	/* 间隔线 end*/

	/* 阴影 start*/
	.home-shadow {
		border-radius: 24rpx;
		padding: 30rpx 30rpx 0 30rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.02);
	}

	/* 信息内容 */
	.king-list {
		display: block;
		background-color: #ffffff;
	}

	.king-list>.king-item {
		padding: 20rpx 30rpx 10rpx 88rpx;
		position: relative;
		display: block;
		z-index: 0;
	}

	.king-list>.king-item::after {
		content: "";
		display: block;
		position: absolute;
		width: 1rpx;
		background-color: #F8F7F8;
		left: 30rpx;
		height: 100%;
		top: 0;
		z-index: 8;
	}

	.king-list>.king-item::before {
		display: block;
		position: absolute;
		top: 20rpx;
		z-index: 9;
		background-color: #ffffff;
		width: 40rpx;
		height: 40rpx;
		text-align: center;
		border: none;
		line-height: 40rpx;
		left: 12rpx;
	}

	.resume {
		display: flex;
		border-radius: 6rpx;
		color: #666;
		// line-height: 1.6;
	}

	.resume+.resume {
		margin-top: 0rpx;
	}

	.resume2 {
		padding-top: 10rpx;
		border-radius: 6rpx;
		display: block;
		color: #666;
		line-height: 1.6;
		text-align: justify;
	}

	/* 用户头像 start */
	.user-image {
		width: 80rpx;
		height: 80rpx;
		position: relative;
	}

	.user-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: center;
		// box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 100rpx;
		overflow: hidden;
		border: 1rpx solid #F8F8F8;
		// background-color: #FFFFFF;
	}



	/* 标签内容 start*/
	.tn-tag-content {
		&__item {
			display: inline-block;
			padding: 5rpx 15rpx;
			margin: 0rpx 20rpx 25rpx 0rpx;
			border-radius: 10rpx;

			&--prefix {
				font-size: 24rpx;
				padding-right: 10rpx;
			}
		}
	}

	/* 标签内容 end*/

	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 140rpx;
		height: calc(160rpx + env(safe-area-inset-bottom) / 2);
		height: calc(160rpx + constant(safe-area-inset-bottom));
	}
</style>